﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MvcSystemsCommander.Extensions.Navigation
{
    public class MSCHttpUnauthorizedResult : HttpUnauthorizedResult
    {
        public string ViewName { get; set; }

        public MSCHttpUnauthorizedResult()
            : base()
        {
            ViewName = "Login";
        }

        public override void ExecuteResult(ControllerContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            var viewResult = new ViewResult { ViewName = ViewName };
            viewResult.ExecuteResult(context);
        }
    }
}